import java.util.ArrayList;
import java.util.Iterator;

public class UnitErr {
	public ArrayList<Units.Dunits> dunits; 
	public Iterator<Units.Dunits>  curr_derr; 
	
	UnitErr(int m) {
		dunits = new ArrayList<Units.Dunits>();
		for(Units.Dunits val: Units.Dunits.values()) {
			dunits.add(val);
		}
		curr_derr  = dunits.iterator();
	}
	
	public Units next_err(Units u, int m) {
		if(m == Baxterpump.Mode.PI) {
			while(curr_derr.hasNext()) {
				Units.Dunits un = curr_derr.next();
				if(un != u.dunits) {
					return (new Units(un)); 
				}
			}
		}
		return null;
	}
	
	public void reset() {
		curr_derr  = dunits.iterator();
	}		

}
